package br.edu.ufcg.greengrid;

import static org.junit.Assert.assertEquals;

import java.util.Collection;
import java.util.Iterator;

public abstract class AbstractTest {

	protected <E extends Object> void assertIsEqual(String message, Collection<E> c1, Collection<E> c2) {
		
		assertEquals(message, c1.size(), c2.size());

		Iterator<E> iter1 = c1.iterator();
		Iterator<E> iter2 = c2.iterator();

		while (iter1.hasNext()) {
			assertEquals(message, iter1.next(), iter2.next());
		}
	}
	
	protected <E extends Object> void assertIsEqual(Collection<E> c1, Collection<E> c2) {
		assertIsEqual("", c1, c2);
	}
	
	protected <E extends Object> void syso(Collection<E> c){
		for (E e : c) {
			System.out.println(e);
		}
	}

	protected String tabulate(String text) {
		return text.replace(" ", "\t");
	}

	
}
